<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                template="/mobile/templates/blankPageTemp.xhtml"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:p="http://primefaces.org/ui"
                xmlns:pm="http://primefaces.org/mobile" 
                xmlns:rich="http://richfaces.org/rich"
                xmlns:a4j="http://richfaces.org/a4j">

    <ui:define name="page">
         <pm:view id="register">
           <pm:header title="Rejestracja">             
            <f:facet name="left"><p:button value="Wróć" icon="back" onclick="PrimeFaces.back()"/></f:facet>
            </pm:header>
             <pm:content>
     

            <p:messages autoUpdate="true" severity="info, error"/> 
    
            <h:form>
             
            <p:inputText id="na" value="#{validationBean.email}" label="Email:" style="width: 100%;" required="true" >  
                   
                    <p:ajax update="msgNam" event="keyup" />  
                </p:inputText>
                <p:message for="na" id="msgNam" display="icon"/> 
                

                <p:inputText id="pass" value="#{validationBean.password}" label="Hasło:" required="true" type="password" >  
                    <p:ajax update="msgNami" event="keyup" />  
                </p:inputText>
                <p:message for="pass" id="msgNami" display="icon"/> 

                <p:inputText id="name" value="#{validationBean.name}" label="Imię:" required="true" >  
                        <f:validateLength minimum="2" maximum="20" />  
                    <p:ajax update="msgNamsi" event="keyup" />  
                </p:inputText>
                <p:message for="name" id="msgNamsi" display="icon"/> 
                
                <p:inputText id="naz" value="#{validationBean.lastName}" label="Nazwisko:" required="true" >  
                           <f:validateLength minimum="2" maximum="50" />  
                    <p:ajax update="msgNaz" event="keyup" />  
                </p:inputText>
                <p:message for="naz" id="msgNaz" display="icon"/> 
    
                <p:inputText id="city" value="#{validationBean.city}" label="Miasto:" required="true">  
                           <f:validateLength minimum="2" maximum="30" />  
                    <p:ajax update="msgC" event="keyup" />  
                </p:inputText>
                <p:message for="city" id="msgC" display="icon"/> 
                
                
                <p:inputText id="zip" value="#{validationBean.zipCode}" label="Kod pocztowy:" required="true">  
                           <f:validateLength minimum="2" maximum="15" />  
                    <p:ajax update="msgZZ" event="keyup" />  
                </p:inputText>
                <p:message for="zip" id="msgZZ" display="icon"/> 
                
                <p:inputText id="str" value="#{validationBean.street}" label="Ulica:" required="true">  
                           <f:validateLength minimum="2" maximum="30" />  
                    <p:ajax update="msgStr" event="keyup" />  
                </p:inputText>
                <p:message for="str" id="msgStr" display="icon"/> 
                
                <p:inputText id="hou" value="#{validationBean.houseNumber}" label="Numer domu:" required="true">  
                           <f:validateLength minimum="1" maximum="15" />  
                    <p:ajax update="msgHH" event="keyup" />  
                </p:inputText>
                <p:message for="hou" id="msgHH" display="icon"/> 
                
                <p:inputText id="loc" value="#{validationBean.localNumber}" label="Numer lokalu:" >  
                           <f:validateLength  maximum="11" />  
                    <p:ajax update="msgLL" event="keyup" />  
                </p:inputText>
                <p:message for="loc" id="msgLL" display="icon"/> 
                
                <p:inputText id="nip" value="#{validationBean.nipNumber}" label="Nip:" >  
                           <f:validateLength  maximum="11" />  
                    <p:ajax update="msgnu" event="keyup" />  
                </p:inputText>
                <p:message for="nip" id="msgnu" display="icon"/>
                
                <p:inputText id="lpho" value="#{validationBean.phone}" label="Telefon:" >  
                           <f:validateLength  maximum="11" />  
                    <p:ajax update="msgPH" event="keyup" />  
                </p:inputText>
                <p:message for="lpho" id="msgPH" display="icon"/>
                
               
              
               <p:selectBooleanCheckbox id="booleanCheckbox" value="#{validationBean.agreed}" itemLabel="#{bundle['registration.confirm']}" label=""/>
                
               <p:commandButton  action="#{validationBean.registryM()}" type="bttton" value="Wyślij" update=":sc">
                        
               </p:commandButton> 
          </h:form>
       
                 </pm:content>
         </pm:view>

         <pm:view id="sc" >

            <pm:header title="Podsumowanie">
                <f:facet name="left"><p:button value="Wróć" icon="back" onclick="PrimeFaces.back()"/></f:facet>
            </pm:header>
            <p:messages autoUpdate="true" severity="info, error"/> 
            <pm:content >
                <h:outputText value="Dziękujemy za zarejestrowanie! Twoje konto jest już aktywne." />
                <p:button value="Wróć do strony głównej" icon="home" href="/mobile/index.xhtml" styleClass="ui-btn-active ui-state-persist"/>
            </pm:content>
        </pm:view>
    </ui:define>
</ui:composition>